package com.project.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.project.entity.ProMember;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface ProMemberMapper extends BaseMapper<ProMember> {
    //获取负责人userId
    @Select("select user_id from pro_member where project_id=#{projectId} and sort=0")
    public Long getMasterId(Long projectId);
    //获取负责人名字
    @Select("select name from user_member where user_id=#{userId}")
    public String getMasterName(Long userId);

    public List<String> getMembers(Long projectId);

    @Update("update project set change=1 where id=#{id}")
    public void updateChange(Long id);
}
